﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using FluentFTP.Model;

namespace FluentFTP.Converters
{
    public class FtpItemTypeToString : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                FtpItemType valueStrong = (FtpItemType)value;
                switch (valueStrong)
                {
                    case FtpItemType.Folder:
                        return "Folder";
                    case FtpItemType.File:
                        return "File";
                    default:
                        return "Unknown";
                }
            }
            catch { return string.Empty; }

        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
